﻿#if UNITY
using System;

namespace com.susi.util
{
    public class MouseReturner : UnityEngine.MonoBehaviour
    {
        public event Action onMouseEnter;
        public event Action onMouseDown;
        public event Action onMouseDrag;
        public event Action onMouseExit;
        public event Action onMouseOver;
        public event Action onMouseUp;
        public event Action onMouseUpAsButton;
        private void OnMouseDown()
        {
            if (onMouseDown != null) onMouseDown();
        }
        private void OnMouseEnter()
        {
            if (onMouseEnter != null) onMouseEnter();
        }
        private void OnMouseDrag()
        {
            if (onMouseDrag != null) onMouseDrag();
        }
        private void OnMouseExit()
        {
            if (onMouseExit != null) onMouseExit();
        }
        private void OnMouseOver()
        {
            if (onMouseOver != null) onMouseOver();
        }
        private void OnMouseUp()
        {
            if (onMouseUp != null) onMouseUp();
        }
        private void OnMouseUpAsButton()
        {
            if (onMouseUpAsButton != null) onMouseUpAsButton();
        }
    }
}
#endif